import {reqSearchRes} from '../../api/index.js'
const state = {
    searchList:[]
};
const mutations = {
    GETSEARCHRES(state,data){
        state.searchList = data;
    }
};
const actions = {
    async getSearchRes({commit},keyword){
        let res = await reqSearchRes(keyword);
        if (res.code == 200) {
            commit('GETSEARCHRES',res.data);
        }
    }
};
const getters = {
    searchObj: (state)=>state.searchList[0]?state.searchList[0].showList:[],
};
export default {
    state,
    mutations,
    actions,
    getters
}
